home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / mdef < prev    next >
Internet Message Format  |  1995-03-31  |  9KB

  1. From: Simone Rapisarda <Simone.Rapisarda@p10.f800.n33.z2.fidonet.org>
  2. Subject:  v04i025:  mdef - Macro Definer to speed up programming v1.0, Part01/01
  3. Newsgroups: comp.sources.hp48
  4. Followup-To: comp.sys.hp48
  5. Approved: spell@seq.uncwil.edu
  6.  
  7. Checksum: 4035502842 (verify with brik -cv)
  8. Submitted-by: Simone Rapisarda <Simone.Rapisarda@p10.f800.n33.z2.fidonet.org>
  9. Posting-number: Volume 4, Issue 25
  10. Archive-name: mdef/part01
  11.  
  12.  
  13. BEGIN_RDME mdef.rdm
  14.  
  15. This is the macro definer I posted at the end of february to comp.sys.hp48.
  16. The doc is a little bit improved.
  17.  
  18. It's written in user-RPL but it isn't painful to use.
  19. Now I don't have the time to work on the system-RPL version but someday,
  20. maybe I'll have it.
  21. Owever the time you'll have to wait for the system-RPL version is
  22. proportional in an inverse order to the number of people that will
  23. encourage me working on it (Suggestion are also welcome).
  24.  
  25.  
  26. ciao
  27.  
  28.                                                   RAP
  29. END_RDME
  30.  
  31. BEGIN_DOC mdef.doc
  32.  
  33.                                   M D E F
  34.  
  35.                                 version 1.0
  36.  
  37.                                     by
  38.  
  39.                               S. A. Rapisarda
  40.  
  41.  
  42.  
  43. This is complete idiot proof macro definer written in user-RPL.
  44. It's a very useful tool to write user-RPL programs (expecially the ones that
  45. make a lot of stack manipulations) seeing immediately the consequences caused
  46. by the instructions you enter. So, while writing a program, you don't have to
  47. remember the position of each object on the stack and everything else.
  48.  
  49.  
  50. INSTRUCTIONS:
  51.  
  52. Download the MDEF directory, enter in it and when everything is ready
  53. enter the custom menu, you will find these six labels:
  54.  
  55. BEGIN  Begin the macro definition.
  56.  
  57. END    Finish the macro definition (the macro will be pushed on the stack
  58.        as a program).
  59.  
  60. PAUSE  Pause the macro definition (press it again to restart the definition).
  61.  
  62. ADD1   Add the first level object to the macro.
  63.  
  64. EDIT   Edit the macro (press ENTER when finished).
  65.  
  66.  
  67. MDEF will record all programmable keystrokes, the non-programmable ones will
  68. be executed but not recorded.
  69. An exception is made for two keys: [STO] and [PURGE]. The corresponding
  70. instructions will no be recorded unless you reassign these instructions to
  71. the keys (the keys will loose their special LASTARG capability).
  72.  
  73. NOTES: The last 22 characters of the macro are always (+/-) displayed in the
  74.        top row of the display.
  75.  
  76.        All the variable contained in the directory are used by the custom
  77.        menu: please don't execute, modify or delete them.
  78.  
  79.        Do not exit the user keyboard while defining a macro.
  80.  
  81.        These programs do COMPLETE error checking.
  82.  
  83.  
  84. Silly example ;)
  85.  
  86. To Create a program that calculates a logarithm in any base do the following:
  87.  
  88. Put the argument of the log in level two and the base in level one then
  89. press [BEGIN] [LN] [SWAP] [LN] [SWAP] [/] [END].
  90. At the end you will find in level one the following program:
  91. \<< LN SWAP LN SWAP / \>>
  92. And in level two the log you just calculated (so you're shure that the
  93. program in level one works correctly).
  94.  
  95. Ciao
  96.  
  97.                                         RAP
  98. END_DOC
  99.  
  100. BEGIN_ASC mdef.asc
  101. %%HP:;
  102. "69A20FF7003000000060FD54E445542560D9D20E163278BF18B9C13CE224B2A2
  103. D9AE1AFE22D9D204563284E2050D4143425F497632C2A207000002E0CF176BA1
  104. B440284E2050D444943505B21305BF228DBF15DF2293632B21302A00060C854E
  105. 445542560D9D20E163278BF11C432D6E201037E1632FD33262BC1F1732D9D20C
  106. 2A2050000DBBF147A2084E201065B213076BA1FD332AC422F1732D9D203FBF18
  107. 4E2050D4449435054B2A2933A1B21305DF2278BF145632D6E20103797632DCC0
  108. 262BC1B21305DF224563284E2050D4143425F497632C2A207000002D6E201037
  109. 76BA1B440284E2050D444943505EF53293632B21301310040345434B440D9D20
  110. E163284E204064C4147468BC1D13A2279E193632B2130E300050D44494350550
  111. D9D20E163284E2050D4143425F478BF18B9C178BF13392010000000000001209
  112. 0DA1DBBF1C58C19C2A2485A1C2A2050000ED2A2485A19C2A24A5A193632B2130
  113. E80004064C41474403392000000000000000001200050D4143425F450C2A2050
  114. 00081000303435453047A2047A20C2A20F000024547494E4D9D20E16323CE228
  115. 4E2040345434B4F88E1AFE22D9D20916C14563284E204064C4147497632DCC02
  116. 339201000000000000269472C1339201000000000000369472C1339201000000
  117. 0000005595D2C184E2050D444943505B21305DF2293632B2130B213047A20C2A
  118. 20B000054E444D9D20E16323CE2284E2040345434B4AFE22D9D2084E204064C4
  119. 1474F76C1C2A2070000BA84E2050D4143425F476BA1B7FC14B2A24563284E204
  120. 064C4147497632DCC02C2A20500004563284E2050D4143425F497632DCC02B21
  121. 305DF2293632B2130B213047A20C2A20F00000514553554D9D20E16323CE2284
  122. E2040345434B4AFE22D9D203392010000000000003693CE22025C1AFE22D9D20
  123. 339201000000000000369472C184E2050D444943505B21305DF22B21305DF229
  124. 3632B2130B213047A20C2A20D000014444413D9D20E16323CE2244CF14B2A2D5
  125. CE184E2040345434B4387E1AFE22D9D204563284E2050D4143425F497632C2A2
  126. 07000002E0CF176BA1B440284E2050D444943505B21305DF2293632B2130B213
  127. 047A20C2A20D000044943505D9D20E16323CE2284E2040345434B4AFE2284E20
  128. 50D4449435055DF2293632B2130B213047A20C2A20D000054449445D9D20E163
  129. 23CE2284E2040345434B4AFE22D9D2033920100000000000082069112C2A2050
  130. 00084E2050D4143425F478BF18B9C19C2A276BA147A2084E201065B213076BA1
  131. 76BA1FD332AC422F17323FBF15BF22D9D204563284E2050D4143425F497632DC
  132. C02B21305DF2284E2050D4449435054B2A269112B21305DF2293632B2130B213
  133. 0B2130C58B"
  134. END_ASC
  135.  
  136.  
  137. BEGIN_UU mdef.uue
  138. begin 644 mdef
  139. M2%!(4#0X+466*O!_``,````&WT5.5$52!ITMX&$CA_N!FQS#+D(K*IWJH>\B
  140. MG2U`92-(+E#0%#0D]91G(RPJ<```(`[\<;8:2P2"Y`(%341)4U`K,5#[(MC[
  141. M4?TB.3:R$@.B`&#`6.1$521ET-D"'C9RN!_!--+F`@%S'C;R/2,FR_%Q(YTM
  142. MP*("!0#0NQ]T*H#D`@%6*S%PMAK?,Z),(A\WTMD"\_N!Y`(%341)4U"THI(S
  143. M&BLQ4/TBA_M!92-M+A`PEV<CS0QBLAPK,5#](E0V@N0"!4U!0U)/>3;"H@('
  144. M``#2Y@(!<V>KL40@2"Y0T$24-`7E7R,Y-K(2`S$!0#!4-+1$T-D"'C:"Y`($
  145. M1DQ!1X;+T3$J<NF18R,K,>`#``5-1$E34`6=+>!A(T@N4-`4-"3U=+@?N,EQ
  146. MN!\S*1`````````AD-`:O?O!A1S)HD)8&BPJ4```WJ)"6!K)HD):&CDVLA(#
  147. MC@!`8,04=$0PDP(``````````"$`4-`4-"3U5,"B`@4`@`$``T-35`-T*D"G
  148. M`BPJ\```0D5'24Z=+>!A(\,N@N0"!$-%0TN/Z*'O(ITMD&$<5#:"Y`($1DQ!
  149. M1WDVTLP@,RD0````````8DDG'#,I$````````&-))QPS*1````````!562T<
  150. M2"Y0T$24-`6U$@/5+Y)C(RLQL!(#="K`H@(+`%#D1-39`AXV,NPB2"Y`,%0T
  151. MM*3O(ITM@.0"!$9,04=_QL&B`@<`L(KD`@5-04-23V>KL?<<M*)"92-(+D!@
  152. MQ!1TE&<CS0S"H@(%`$!E(T@N4-`4-"3UE&<CS0RR$@/5+Y)C(RLQL!(#="K`
  153. MH@(/```55#55U-D"'C8R[")(+D`P5#2TI.\BG2TPDP(!```````PEL,N`E(<
  154. M^B[2V0(S*1````````!C22<<2"Y0T$24-`6U$@/5+[(2`]4ODF,C*S&P$@-T
  155. M*L"B`@T`$$1$%-/9`AXV,NPB1/Q!*RI=[('D`@1#14-+@^>A[R*=+4!E(T@N
  156. M4-`4-"3UE&<C+"IP```@#OQQMAI+!(+D`@5-1$E34"LQ4/TB.3:R$@,K,4"G
  157. M`BPJT```1$E34)TMX&$CPRZ"Y`($0T5#2_HN@N0"!4U$25-0U2^28R,K,;`2
  158. M`W0JP*("#0!01)1$U=D"'C8R[")(+D`P5#2TI.\BG2TPDP(!``````"``I81
  159. MPJ("!0"`Y`(%34%#4D^'^X&;',FB<K8:="J`Y`(!5BLQ<+8:9ZOQ/2/*)/)Q
  160. M(_/[4?LBG2U`92-(+E#0%#0D]91G(\T,LA(#U2^"Y`(%341)4U"THF(9(2LQ
  161. -4/TB.3:R$@,K,;`2`[`2
  162. `
  163. end
  164. END_UU
  165.  
  166. BEGIN_RPL mdef.rpl
  167. %%HP: T(3)A(D)F(.);
  168. DIR
  169.  CST  { { "BEGIN"
  170.            \<<
  171.            IF CECK NOT
  172.            THEN RCLF 'FLAG' STO -62 SF -63 SF -55 CF MDISP
  173.            END
  174.            \>>
  175.         }
  176.         { "END"
  177.            \<<
  178.            IF CECK
  179.            THEN FLAG STOF "\<<" MACRO + OBJ\-> 0 'FLAG' STO "" 'MACRO' STO
  180.            END
  181.            \>>
  182.         }
  183.         { "PAUSE"
  184.           \<<
  185.           IF CECK
  186.           THEN -63
  187.             IF FC?C
  188.             THEN -63 SF MDISP
  189.             END
  190.           END
  191.           \>>
  192.         }
  193.         { "ADD1"
  194.           \<<
  195.           IF DEPTH 0 > CECK AND
  196.           THEN 'MACRO' " " ROT + STO+ MDISP
  197.           END
  198.           \>>
  199.         }
  200.         { "DISP"
  201.           \<<
  202.           IF CECK
  203.           THEN MDISP
  204.           END
  205.           \>>
  206.         }
  207.         { "EDIT"
  208.           \<<
  209.           IF CECK
  210.           THEN 28 MENU "" MACRO DUP SIZE 1 + { V } + +
  211.               IFERR INPUT
  212.               THEN DROP2
  213.               ELSE 'MACRO' STO
  214.               END
  215.             MDISP 0 MENU
  216.           END
  217.           \>>
  218.         }
  219.       }
  220.  
  221.  MACRO  ""
  222.  
  223.  FLAG  0
  224.  
  225.  MDISP  \<< MACRO DUP SIZE DUP 21 - SWAP SUB 1 DISP "" 2 DISP 1 FREEZE \>>
  226.  
  227.  CECK  \<< FLAG TYPE 5 == \>>
  228.  
  229.  \GaENTER  \<< DUP \-> s
  230.              \<<
  231.                IFERR STR\->
  232.                THEN "" SWAP { V } +
  233.                    IFERR INPUT
  234.                    THEN DROP2 MDISP 0 DOERR
  235.                    END
  236.                  DUP 's' STO STR\->
  237.                END
  238.                'MACRO' " " s + STO+ MDISP
  239.              \>>
  240.            \>>
  241.  
  242. \GbENTER  \<< DUP SIZE
  243.               IF 0 \=/
  244.               THEN 'MACRO' " " ROT + STO+ MDISP
  245.               ELSE DROP
  246.               END
  247.           \>>
  248. END
  249. END_RPL
  250. --  
  251.  WolfNet BBS Pisa (Italy) Tel. +39-50-589050 300-14.4K Baud Matrix 2:332/602.0
  252.  Simone Rapisarda - via FidoNet node 2:33/800
  253.  UUCP: ...!gear!wolf!800.10!Simone.Rapisarda
  254.  ARPA: Simone.Rapisarda@p10.f800.n33.z2.fidonet.org
  255.  
  256.